Cloud Team Collections (S3 + Supabase) - #8052
Conversation
…mits, byte-identical), #8048 closed Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
02e5610 to
8ac48df
Compare
|
@greptile-apps review (Claude Fable 5: regenerated packaging branch — same 9 review-grained commits, now including the 13-14 Jul dogfood fixes: member display names + CONTRACTS v1.6, identity-first book resolution, --attended launch flag, remote-rename dedup, pending-invite constraint fix. Byte-identical to cloud-collections at f5a00c1.) |
|
| Filename | Overview |
|---|---|
| supabase/migrations/20260717000001_tc_last_admin_guard_lock.sql | Replaces the last-admin guard trigger to serialize concurrent admin removals via FOR UPDATE on the parent collection row — correctly fixes the TOCTOU race and is exercised by pgTAP test 11a. |
| supabase/migrations/20260717000002_tc_support_set_admin.sql | Adds service-role-only admin-recovery function; correctly REVOKEs PUBLIC EXECUTE and GRANTs only to service_role; idempotent upsert logic is sound; pgTAP tests 11b–11d cover promote, insert, and auth-gate paths. |
| supabase/migrations/20260717000003_tc_list_stale_upload_garbage.sql | Worklist RPC for the orphaned-upload sweep; SECURITY DEFINER + service_role-only grant; excludes live-transaction paths correctly; paired with pgTAP section 12. |
| supabase/functions/sweep-stale-uploads/index.ts | New edge function for GC of orphaned S3 uploads; service-role gate is checked eagerly; correctly deletes only versions newer than the committed reference; referencedMissing counter surfaces data loss risk without destructive action. |
| supabase/functions/sweep-stale-uploads/index.test.ts | Deno unit tests cover all four branches: normal GC, null-referenced (all orphaned), referenced-missing (skip + report), and non-service-role 403. |
| supabase/functions/_shared/s3.ts | Adds listObjectVersions and deleteObjectVersion helpers for the sweep; no-pagination design is explicitly justified by the 7-day lifecycle rule bounding version accumulation per key. |
| Design/CloudTeamCollections/SCHEMA.md | New ER diagram doc for the tc schema; accurate through migration 20260716000001; the 20260717 migrations don't add tables/columns so the diagram remains current. |
| Design/CloudTeamCollections/CONTRACTS.md | Added Cloud functions section explaining the Postgres-RPC vs. edge-function distinction for reviewers; existing contract content unchanged. |
| DistFiles/localization/en/Bloom.xlf | Adds ~15 new trans-units for cloud Team Collections UI; the previously-flagged double-hyphen in the CollectionTab.BookNotYetDownloaded note has been replaced with a semicolon. |
| supabase/tests/01_tc_schema_test.sql | Adds pgTAP sections 11 and 12: lock-guard assertion (11a), support_set_admin promote/insert/auth-gate (11b–11d), and the stale-garbage worklist (section 12). |
| supabase/migrations/20260716000001_tc_get_collection_file_manifest.sql | Adds get_collection_file_manifest RPC (CONTRACTS.md v1.7) — read-only, SECURITY DEFINER, granted to authenticated; exposes existing collection_group_files data for pinned downloads. |
| src/BloomExe/TeamCollection/Cloud/CloudAuth.cs | Provider-agnostic session core; DPAPI-backed persistent store for production; proactive refresh at 80% TTL; large new file with thorough doc comments. |
Reviews (7): Last reviewed commit: "Cloud TC E2E: Playwright-over-CDP harnes..." | Re-trigger Greptile
…e P1) L10NSharp routes <note> content through XML-comment parsing, where '--' is illegal, so the CollectionTab.BookNotYetDownloaded note's '... confirmation -- may belong ...' crashed Bloom at startup with "An XML comment cannot contain '--'" once localization loaded. Replace the '--' with a semicolon. Found by Greptile on PR #8052; matches the known failure the xlf-strings skill documents. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
8ac48df to
b45e5e2
Compare
b45e5e2 to
8fbe66e
Compare
|
@greptile-apps review (Claude Fable 5) Regenerated review branch: re-merged origin/master, and folded in fixes for the Devin slice-review findings (upload-race lock, cache LockedSeat/LocalVersionSeq, experimental-feature-flag token collision, blank cloud history-event label). Byte-identical to the cloud-collections working branch. |
…obes cleaned up; Greptile re-running
8fbe66e to
aa3842f
Compare
|
@greptile-apps review (Claude Fable 5) Regenerated after a fresh-eyes review pass over yesterday's fixes: hardened the remote-rename guard (now keyed to the authoritative repo lock, so a checked-out-and-renamed book can't be reverted/clobbered at startup), display-name cache now invalidates on account switch, and the run.sh freshness check uses build outputs that incremental builds actually touch. Regeneration scripts now live in-repo (Design/CloudTeamCollections/orchestration/regen-*.sh). Byte-identical to cloud-collections. |
aa3842f to
51da40f
Compare
|
@greptile-apps review (Claude Fable 5) Regenerated after a documentation cleanup: removed 13 spent orchestration scratch files (one-time agent launch prompts, an implemented design sketch, stale scouting notes) — the diff shrinks from 256 to 243 files. The durable docs (design, CONTRACTS, GOING-LIVE deploy plan, task specs, state log, regeneration procedure) are unchanged. No code changes beyond three comment pointers in the e2e harness. Byte-identical to cloud-collections. |
51da40f to
98bc352
Compare
|
@greptile-apps review (Claude Code, Opus 4.8) Regenerated after applying the /simplify quality-review pass across the whole branch — intended as no behavior change:
Verification: C# required filter 442/442, vitest + deno green. One item worth a look: |
All 3 /simplify batches done + committed (6 logical-chunk commits); C# 442/442, vitest/deno green. Live e2e blocked by environment (WebView2 about:blank under the machine's memory pressure, not a regression). PR #8052 regenerated locally + byte-identical, force-push held for John's explicit OK. Flags recorded: master-merge/launcher reconciliation, live-e2e + launcher smoke for John's env, and the ReceiveAllUpdates/GetUpdatesAvailableCount predicate drift. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…PASS With memory freed (49% free), e2e-1 + e2e-2 both pass through the live Supabase+MinIO stack, live-verifying R1/R2 and ReceiveAllUpdates. Earlier about:blank failures were the documented memory-pressure flake. PR #8052 regenerated + force-pushed byte-identical; Greptile re-triggered. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
98bc352 to
9de218b
Compare
|
@greptile-apps review (Claude Code, Opus 4.8) Regenerated after merging current Backend efficiency (no behavior change):
Behavior changes (intentional, decided with John):
Test-only refactors (no production change):
Verification: cloud/TC C# filter 453/453; front-end consumer vitest 38/38; pgTAP/deno green earlier this cycle; live e2e-1/e2e-2 previously passed. |
Records the origin/master merge (10 commits, zero conflicts, merge not rebase because cloud-collections is shared), the cloud-collections push, and the cloud-tc-for-review regeneration (0 unmatched, byte-identical, force-pushed, Greptile re-triggered). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…kers Documentation-only clarity pass over the Cloud Team Collections design docs, prompted by review questions. No behavior change (comments and docs only). - CONTRACTS.md: group the Postgres-RPC and edge-function sections under a new "Cloud functions" heading with a short primer on the difference (RPCs run in the database; edge functions are separate programs that alone hold the AWS creds), for readers who don't work in the DB backend. - SCHEMA.md (new): a mermaid ER diagram of the whole tc schema, with reviewer notes (soft references; version_files holds only the current manifest; the ephemeral *_transactions tables) and instructions for keeping it in sync. - config.toml: a DEV-ONLY banner on the [auth] block -- the whole file configures the local supabase stack and is never read by a hosted project; production auth is Firebase third-party. - 20260706000001 (schema): a pointer to SCHEMA.md + "update the diagram when you change the schema" guidance. - 20260706000004 (checkin txns): a DEV-ONLY caveat at the *_tx `authenticated` grants pointing to GOING-LIVE 2.4 (lock these down before production). - REVIEW-PLAN.md (new): a prioritized human-review plan for PR #8052. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9de218b to
e3b5a26
Compare
|
@greptile-apps review (Claude Code, Opus 4.8) Regenerated after a documentation + server-hardening pass from review discussion. Byte-identical to Docs / clarity (no behavior change):
Server hardening (new migrations + edge function, all tested):
Verification: pgTAP 102/102; sweep Deno unit tests 4/4; Note: the packaging branch is built on the same master commit as before ( |
e3b5a26 to
305efe8
Compare
|
Too many files changed for review. ( Bypass the limit by tagging |
ff19330 to
3d9068a
Compare
Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…transactions Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…DK v4) Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…flow, background downloads, account-switch handling Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… book-list merge Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…oad placeholders Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Part of the Cloud Team Collections feature (S3 + Supabase backed Team Collections). This branch is a regenerable review-grained packaging of the cloud-collections working branch; only the final tree is test-verified (see Design/CloudTeamCollections/orchestration/SQUASH-PLAN.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3d9068a to
ad1b15d
Compare
The full Cloud Team Collections feature — a cloud backend (one S3 bucket + Supabase Postgres/edge functions) for Bloom's Team Collections, alongside the existing folder implementation — packaged as 9 dependency-ordered, review-grained commits. Replaces draft PR #8048 (same tree, byte-identical — verified by an empty
git diffagainst thecloud-collectionsworking branch), whose ~200 orchestration-grained commits were not reviewable.Suggested review order = commit order:
tcschema, RLS, RPCs, pgTAP (65 green)CloudTeamCollection, polling monitor, progressive join, background downloads, account-switch takeover with per-collection-copy seatsReview caveat: each commit is a coherent reviewable unit and the order makes most of them compile, but only the FINAL tree is test-verified (C# cloud filter 428/428, full suite green, pgTAP 65/65, deno 33/33, E2E matrix green with every scenario passing on this tree). This is the accepted trade-off; per-commit CI-green is not a goal.
Bot review history (on #8048): Greptile reviewed the full diff via the file-limit bypass, found 1 P1 (S3 credential scoping) + 2 P2s — all fixed and verified resolved by its re-review ('No new blocking issues'). Devin cannot analyze a diff this size. CI green.
Remaining before merge: John's two [HUMAN] visual checks (centered check-in dialog; real web upload/download per GOING-LIVE.md 4.3) and the OUTSTANDING BUGS #0 follow-up decision (server-side same-user cross-seat check-in) — tracked in
Design/CloudTeamCollections/orchestration/DOGFOOD-BATCH-1.md.🤖 Generated with Claude Code
Devin review
This change is